package com.liner.homework.third;


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class StudentTest {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {

        System.out.print("请输入将要录入学生人数:");
        int num = scanner.nextInt();
        List<Student> students = new ArrayList<>();
        for (int i = 1; i <= num; i++) {
            System.out.println("第"+i+"位学生信息:");
            System.out.print("请输入学生姓名:");
            String name = scanner.next();
            System.out.print("请输入年龄:");
            int age = scanner.nextInt();
            System.out.print("请输入班级:");
            String grade = scanner.next();
            System.out.print("请输入学号:");
            String stuId = scanner.next();

            Student student = new Student(name, age, grade, stuId);
            students.add(student);
        }

        for (Student student : students) {
            student.sayHi();
            student.study();
        }
    }
}
